package com.atguigu.gmall.product.controller;


import com.atguigu.gmall.model.product.SkuImage;
import com.atguigu.gmall.model.product.SkuInfo;
import com.atguigu.gmall.product.mapper.SkuImageMapper;
import com.atguigu.gmall.product.service.ManageService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
public class TestController {

    @Autowired
    private ManageService manageService;

    @GetMapping("/test/index")
    public String index(HttpServletRequest request, Model model){

        SkuInfo skuInfo = manageService.getSkuInfoById(1L);
        model.addAttribute("skuInfo",skuInfo);
        request.setAttribute("hello","大家好");
        return "index";
    }
}
